
import requests
from json import JSONDecoder
# import re


http_url ="https://api-cn.faceplusplus.com/facepp/v3/detect"

key ="jRpCaZ34kqNYJ8Zppdc-yGGum_YkETov"

secret ="Vr0PtRCw-ZFwYXTKVfi6aDNaSqlfunK3"

filepath ="image/tupian.jpg"

data = {"api_key":key,"api_secret":secret,"return_landmark":"1"}

files = {"image_file":open(filepath,"rb")} #rb:以二进制方法读取

response = requests.post(http_url, data=data, files=files)

req_con = response.content.decode('utf-8')

req_dict = JSONDecoder().decode(req_con)

print(req_con)